#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QFileDialog>
#include <QDebug>
#include <QInputDialog>

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
}

MainWindow::~MainWindow()
{
    delete ui;
}


void MainWindow::on_pushButton_clicked()
{
    QString fileName = QFileDialog::getOpenFileName();
    qDebug()<<fileName;
}

void MainWindow::on_pushButton_2_clicked()
{
    QString fileName = QFileDialog::getSaveFileName();
    qDebug()<<fileName;
}

void MainWindow::on_pushButton_3_clicked()
{
    double rest = QInputDialog::getDouble(this,"浮点数","输入一个浮点数");
    qDebug()<<rest;
}

void MainWindow::on_pushButton_4_clicked()
{
    int rest = QInputDialog::getInt(this,"整数","输入一个整数");
    qDebug()<<rest;
}

void MainWindow::on_pushButton_5_clicked()
{
    QStringList lists;
    lists.push_back("111");
    lists.push_back("222");
    lists.push_back("333");
    QString list = QInputDialog::getItem(this,"条目型","输入一个条目型",lists);
    qDebug()<<list;

}
